const IP =
  '^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$'
const IPNET =
  '^(([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\/(\\d{1}|[0-2]{1}\\d{1}|3[0-2])$'
const IPANDNET =
  '^((0|1[0-9]{0,2}|2[0-9]{0,1}|2[0-4][0-9]|25[0-5]|[3-9][0-9]{0,1})\\.){3}(0|1[0-9]{0,2}|2[0-9]{0,1}|2[0-4][0-9]|25[0-5]|[3-9][0-9]{0,1})(?:\\/([0-9]|[1-2][0-9]|3[0-2])|)$'
const IPANDPORT =
  '^((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?):([0-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$'
const DOMAIN = /^(?=^.{3,255}$)[a-zA-Z0-9\\*][-a-zA-Z0-9\\*]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/
const IPANDDOMAIN =
  '^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$|^[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+(\\.[a-zA-Z]+)$|^[a-zA-Z0-9_-]+(\\.[a-zA-Z]+)$'
const URLS = '^[\\w\\*\\[\\]\\?][\\w\\*\\.\\?\\[\\]\\!-\\/:]*$'
const PORT1 = /(?=(\b|\D))(((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))|(?=(\b|\D))\/([1-2][0-9]|3[0-2]|[1-9])/
const PORT = /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))|\*)((\/([012]\d|3[012]|\d))?)(,((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))|\*)((\/([012]\d|3[012]|\d))?))*$/
const PORT2 = /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25}(;[ ]{0,1}([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})*$/ //邮箱加逗号
//   '^([1-9],|[1-9]\\d,|[1-9]\\d{2},|[1-9]\\d{3},|[1-5]\\d{4},|6[0-4]\\d{3},|65[0-4]\\d{2},|655[0-2]\\d,|6553[0-5],)+$' //    端口加逗号
const PORT3 = /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25}(,[ ]{0,1}([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})*$/ //邮箱加逗号
const EMAIL =
  '[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$'
const ChineNo = '^[^\u4e00-\u9fa5]+$' ///不包含中文
const IP2 =
  '^(\\d{1,3}|\\*)(\\.(\\d{1,3}|\\*)){3}(,(\\d{1,3}|\\*)(\\.(\\d{1,3}|\\*)){3})*'
const ip_Url = /^((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d)(\.((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d)){3}$|^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/
const EMAILUSERNAME = '^[a-zA-Z0-9_@.-]{1,20}$'
// ^(?=(\b|\D))(((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))(?=(\b|\D))/([1-2][0-9]|3[0-2]|[1-9])$
const USERNAME = '^([a-zA-Z0-9_\u4e00-\u9fa5]){3,16}$'
const USERNAME64 = '^([a-zA-Z0-9_\u4e00-\u9fa5]){64,64}$'
const USERNAME1 = '^([a-zA-Z0-9_\u4e00-\u9fa5])$'
const PASSWORD =
  '^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z0-9a-zA-Z-._*!$#@^&]{6,12}$$'
const Nonber = '^(([1-9][0-9]{0,1}|100)|0)$'
const numPattern = /^\d*\.?\d+$/ //数字正则
const USERPWD = /^.*(?=.{8,32})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*?_ ]).*$/ // 密码
const EMAILDOMAIN =
  '^(?:\\*|(?:[a-zA-Z0-9_-]+|\\*)@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+)$|^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$'
///^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/
// \w{5,17}
//IP或者IP范围
// ^(?:(?:1[0-9][0-9].)|(?:2[0-4][0-9].)|(?:25[0-5].)|(?:[1-9][0-9].)|(?:[0-9].)){3}(?:(?:1[0-9][0-9])|(?:2[0-4][0-9])|(?:25[0-5])|(?:[1-9][0-9])|(?:[0-9]))$[-]^(?:(?:1[0-9][0-9].)|(?:2[0-4][0-9].)|(?:25[0-5].)|(?:[1-9][0-9].)|(?:[0-9].)){3}(?:(?:1[0-9][0-9])|(?:2[0-4][0-9])|(?:25[0-5])|(?:[1-9][0-9])|(?:[0-9]))$
const IP233 =
  '^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])(-(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])){0,1}$'
const YUNAME = '^[a-zA-Z0-9_-]+(\\.)[a-zA-Z0-9_-]+(\\.[a-zA-Z]+)+$'
const NAME = '^([A-Za-z0-9\\u4e00-\\u9fa5_\\-()]){1,40}$'
const NAME2 = '^[A-Za-z0-9\\u4e00-\\u9fa5]+$'

const IpDuan = /(?=(\b|\D))(((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))(?=(\b|\D))\/([1-2][0-9]|3[0-2]|[1-9])/
const Ipordu = /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){0,3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/

const IporDuan = /^((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(:([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?)(,(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(:([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?)*$/
const IPhd = /^((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}\/([1-2][0-9]|3[0-2]|[1-9])|((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}$/
const NAMERULE2 = { pattern: NAME2, message: '只能输入大小写字母数字汉字' }
const NAMEMAX = { max: 20, message: '最多20个字符' }
const NAMEMAX1 = { max: 32, message: '加密秘钥为32个字符' }
const DESCMAX = { max: 100, message: '最多100个字符' }
const DATARULE = { max: 64, message: '最多64个字符' } //数据安全 识别规则 长度
const NAMERULE = {
  pattern: NAME,
  message: '只能输入大小写字母数字汉字和下划线',
}
// const ePattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/ // 邮件
const mobile = /^0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8}$/
const url = /^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/
const reg = /^[^\s]*$/
var ePattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{1,64})$/
var DOMAINs = /^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/
//黑白名单
const IpWd = /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){0,3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/
const EMLY = /^(?:\\*|(?:[a-zA-Z0-9_-]+|\\*)@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+)$|^(?=^.{3,255}$)@?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/
const Zy = /^([A-Za-z0-9]{32})$/
const ui = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}(?:\/[0-9]{1,2})?$/
const zh = /^(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\/(([0-9])|([1-2]\d)|(3[0-2])))?$/
const IPV6 = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/

export {
  ePattern,
  numPattern,
  EMAIL,
  USERPWD,
  IP,
  reg,
  mobile,
  url,
  EMAILDOMAIN,
  NAME,
  IP233,
  PORT2,
  PORT,
  URLS,
  DOMAIN,
  ip_Url,
  IpDuan,
  IPhd,
  DOMAINs,
  PORT3,
  Ipordu,
  ChineNo,
  IpWd,
  EMLY,
  Zy,
  IporDuan,
  ui,
  zh,
  IPV6,
}

//  import { IP, IPNET, IPANDNET, DOMAIN, URLS, NAMEMAX, DESCMAX} from '../../const/regExp'
//  import {  NAMEMAX, DESCMAX} from '../../const/regExp'

//  rules: [{ type: 'email', message: '请输入正确邮件地址' }],
//  rules: [{ pattern: IPANDNET, message: '请输入IP地址或者IP网段' }],
//  rules: [{ pattern: EMAIL, message: '请输入正确邮件地址或者*' }],
//  rules: [{ pattern: URLS, message: 'URL格式错误' }],
//  rules: [{ pattern: PORT, message: '请输入正确端口(0-65535)' }],
//  rules: [DESCMAX],
//  rules: [DATARULE],
